/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package Utility;

import java.awt.Component;
import java.awt.Dimension;
import java.awt.Image;
import java.awt.Toolkit;
import java.util.List;
import javax.swing.ImageIcon;
import javax.swing.JFrame;
import javax.swing.JLabel;

/**
 *
 * @author Thiago
 */
public class AjustaIcon {
    
    public static void ajustaIconNoLabel(JLabel label, ImageIcon img) {    
        
        try{            
            ImageIcon imgTemp = new ImageIcon(img.getImage().getScaledInstance(label.getWidth(),label.getHeight(),Image.SCALE_DEFAULT));
            label.setIcon(imgTemp);
        } catch(Exception e) {
            throw new RuntimeException(e);
        }
        
    }
    
    public static void ajustaTelaFullScreen(JFrame tela){
        Dimension medidas = Toolkit.getDefaultToolkit().getScreenSize();
        tela.setSize(medidas);        
    }
    
   
    
}
